//
//  NetworkAnalysis.h
//  JP
//
//  Created by LiaoChenliang on 2022/4/13.
//  Copyright © 2022 LiaoChenliang. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, AGNetworkAnalysisSection) {
    AGNetworkAnalysisAll              = 0,
    AGNetworkAnalysisSend             = 1,
    AGNetworkAnalysisRecv             = 2,
};

@protocol AGNetworkAnalysisDelegate <NSObject>

@required

- (NSString *)networkAnalysisSend:(NSInteger )sendID remoteIP:(NSString *)addIP contentLen:(NSInteger)len;
- (NSString *)networkAnalysisRecv:(NSInteger )recvID remoteIP:(NSString *)addIP contentLen:(NSInteger)len;


@end

@interface AGNetworkAnalysis : NSObject

@property (nonatomic, assign, readonly) BOOL isEnableConsole;
@property (nonatomic, assign, readonly) BOOL isEnableFile;
@property (nonatomic, assign, readonly) AGNetworkAnalysisSection analysisSection;
@property (nonatomic, assign, readonly) NSInteger platformType;
@property (nonatomic, copy, readonly) NSString *logPath;
@property (nonatomic, weak) id<AGNetworkAnalysisDelegate> delegate;

+ (AGNetworkAnalysis *)shared;
//开始分析 选择分析类型(默认全部)
- (void )setupAnalysisSection:(AGNetworkAnalysisSection)section;
//是否开启控制台(默认关)
- (void )setupEnableConsole:(BOOL )enable;
//是否开启日志(默认关)
- (void )setupEnableFile:(BOOL )enable;
//设置平台标签(默认0)
- (void )setupPlatform:(NSInteger )type;
- (void )start;
- (void )stop;
@end

NS_ASSUME_NONNULL_END
